<template>
	<view>
		<u-navbar :bgColor="bgColor" :titleStyle="{color: color}" title="认养详情">
			<view
				:style="{opacity: loading ? 0 : 1}"
				class="u-nav-slot u-border-top1 u-border-right u-border-bottom u-border-left"
				slot="left"
			>
				<u-icon
					name="arrow-left"
					size="20"
					color="#000"
					@click="back('back')"
				></u-icon>
				<u-line
					direction="column"
					:hairline="false"
					length="16"
					margin="0 8px"
				></u-line>
				<u-icon
					name="home"
					size="24"
					color="#000"
					@click="back('home')"
				></u-icon>
			</view>
		</u-navbar>
		<scroll-view @scroll="handleScroll" scroll-with-animation :scroll-into-view="intoView"  :scroll-y="true" :style="{height: scrollViewHeight}">
			<template v-if="loading">
				<view style="padding: 32rpx;">
					<u-skeleton avatarSize="48" avatarShape="square" style="margin-bottom: 32rpx;" :loading="loading" avatar rows="7" v-for="i in 6" :key="i"></u-skeleton>
				</view>
			</template>
			<template v-else>
				<TopBanner :detail="detail" height="530rpx" id="top"/>
				<view class="foster-detail-content">
					<view class="foster-detail-t">
						<view>
							<text class="foster-detail-t-1">{{detail.name}}</text>
							<text class="foster-detail-t1-js1" v-if="detail.isDeposit === '1'">预售</text>
						</view>
						<view style="flex: 1;text-align: right;">
							<button open-type="share" style="text-align: right;" class="u-reset-button">
								<text style="font-size: 36rpx;color: #000000;" class="iconfont icon-fenxiang"></text>
							</button>
						</view>
					</view>
					<!-- <view class="foster-detail-t1" style="display: flex;align-items: center;">
						<view style="display: flex;align-items: center;">
							<text style="padding-right: 8rpx;">所在位置:</text>
							<text class="foster-detail-t1-js" :style="{backgroundColor: appColor}">{{detail.dormitoryId_dictText}}</text>
						</view>
					</view> -->
					<view class="foster-detail-t1" style="display: flex;align-items: center;">
						<view>
							<text style="padding-right: 8rpx;">种植时间:</text>
							<text style="color: #000;">{{detail.launchTime.replaceAll('-', '.')}}</text>
						</view>
						<view style="margin-left: 16rpx;">
							<text style="padding-right: 8rpx;">认养时间:</text>
							<text style="color: #000;">{{detail.startTime.replaceAll('-', '.')}}~{{detail.endTime.replaceAll('-', '.')}}</text>
						</view>
					</view>
					<view class="foster-detail-t-11">{{detail.introduction}}</view>
					<view class="foster-detail-m">
						<text style="color: transparent;" v-if="detail.point === 0">0</text>
						<view class="foster-detail-m-1" v-else>购买赠送{{detail.point}}积分</view>
						<view class="foster-detail-m-2" @click="handleShowPrice">
							<text style="color: #f40215; font-size: 32rpx;padding-right: 4rpx">{{detail.price}}</text>
							<text style="color: #969696; font-size: 24rpx;">元/{{detail.unit}}</text>
							<text class="iconfont icon-31yiwen" style="padding-left: 8rpx;color: #000;position: relative;top: 2rpx;"></text>
						</view>
					</view>
					<view class="foster-detail-b">
						<view class="foster-detail-b-item">
							<text style="font-size: 28rpx;" class="iconfont icon-fenlei"></text>
							<text class="foster-detail-b-item-text">品种: {{detail.varieties}}</text>
						</view>
						<view class="foster-detail-b-item">
							<text class="iconfont icon-biaoshengmingzhouqiguanli"></text>
							<text class="foster-detail-b-item-text">周期: {{detail.cycle}}天</text>
						</view>
						<view class="foster-detail-b-item">
							<text style="color: #fff;" class="iconfont icon-shouruzengchang"></text>
							<text style="color: #fff;" class="foster-detail-b-item-text">产量: {{detail.yield}}</text>
						</view>
					</view>
				</view>
				<view class="foster-detail-content1">
					<view class="foster-detail-content1-title">
						<text>认养情况</text>
						<text style="font-size: 28rpx;color: #666;font-weight: normal;">剩余{{(detail.stock - detail.salesNum)}}/{{detail.stock}}</text>
					</view>
					<view style="height: 200rpx;">
						<qiun-data-charts :canvas2d='true' canvasId='canvans8' type="pie" :opts="opts" :chartData="chartData" />
					</view>
				</view>
				<!-- <view class="foster-detail-content1">
					<view class="foster-detail-content1-title">环境监测</view>
					<HomeTitle title="环境监测"/>
					<view class="env-box">
						<view class="env-item env-item1">
							<view style="width: 100%;position: relative;height: 30rpx;">
								<view :style="{backgroundColor: (sensorList[1] && sensorList[1].status || '正常') === '正常' ? 'rgba(42, 175, 96, 1)' : 'rgba(242, 74, 68, 1)'}" class="env-status">{{sensorList[1] && sensorList[1].status || ''}}</view>
							</view>
							<view style="height: 64rpx;display: flex;align-items: center;">
								<u--image mode="aspectFill" src="https://hhymp.oss-cn-hangzhou.aliyuncs.com/home/env-1.png" width="64rpx" height="57rpx"></u--image>
							</view>
							<view class="env-num">
								<text>{{sensorList[1] && sensorList[1].detectionValue || 0}}</text>	
								<text class="env-unit">温度/{{sensorList[1] && sensorList[1].unit || ''}}</text>	
							</view>
						</view>	
						<view class="env-item env-item2">
							<view style="width: 100%;position: relative;height: 30rpx;">
								<view :style="{backgroundColor: (sensorList[1] && sensorList[1].status || '正常') === '正常' ? 'rgba(42, 175, 96, 1)' : 'rgba(242, 74, 68, 1)'}" class="env-status">{{sensorList[0] && sensorList[0].status || ''}}</view>
							</view>
							<view style="height: 64rpx;display: flex;align-items: center;">
								<u--image mode="aspectFill" src="https://hhymp.oss-cn-hangzhou.aliyuncs.com/home/env-2.png" width="46rpx" height="64rpx"></u--image>
							</view>
							<view class="env-num">
								<text>{{sensorList[0] && sensorList[0].detectionValue || 0}}</text>		
								<text class="env-unit">湿度/{{sensorList[0] && sensorList[0].unit || ''}}</text>	
							</view>
						</view>	
						<view class="env-item env-item3">
							<view style="width: 100%;position: relative;height: 30rpx;">
								<view :style="{backgroundColor: (sensorList[1] && sensorList[1].status || '正常') === '正常' ? 'rgba(42, 175, 96, 1)' : 'rgba(242, 74, 68, 1)'}" class="env-status">{{sensorList[2] && sensorList[2].status || ''}}</view>
							</view>
							<view style="height: 64rpx;display: flex;align-items: center;">
								<u--image mode="aspectFill" src="https://hhymp.oss-cn-hangzhou.aliyuncs.com/home/env-3.png" width="64rpx" height="54rpx"></u--image>
							</view>
							<view class="env-num">
								<text>{{sensorList[2] && sensorList[2].detectionValue || 0}}</text>	
								<text class="env-unit">氨气/{{sensorList[2] && sensorList[2].unit || ''}}</text>	
							</view>
						</view>
						<view class="env-item env-item4">
							<view style="width: 100%;position: relative;height: 30rpx;">
								<view :style="{backgroundColor: (sensorList[1] && sensorList[1].status || '正常') === '正常' ? 'rgba(42, 175, 96, 1)' : 'rgba(242, 74, 68, 1)'}" class="env-status">{{sensorList[2] && sensorList[2].status || ''}}</view>
							</view>
							<view style="height: 64rpx;display: flex;align-items: center;">
								<u--image mode="aspectFill" src="https://hhymp.oss-cn-hangzhou.aliyuncs.com/home/step.png" width="64rpx" height="54rpx"></u--image>
							</view>
							<view class="env-num">
								<text>6751</text>	
								<text class="env-unit">步数/步</text>	
							</view>
						</view>	
					</view>
				</view> -->
				<!-- <view class="foster-detail-content1">
					<view class="foster-detail-content1-title">信息公示牌</view> -->
					<!-- <u-row>
						<u-col span="6">
							<view class="cell-class u-border-top1 u-border-left u-border-bottom u-border-right">
								<text class="cell-title">认养人:</text>
								<text class="cell-content">{{detail.managementName || '未设置'}}</text>
							</view>
						</u-col>
						<u-col span="6">
							<view class="cell-class u-border-top1 u-border-bottom u-border-right">
								<text class="cell-title">联系电话:</text>
								<text class="cell-content">{{detail.managementPhone || '未设置'}}</text>
							</view>
						</u-col>
					</u-row> -->
					<!-- <u-row>
						<u-col span="6">
							<view class="u-border-top1 cell-class u-border-left u-border-bottom u-border-right">
								<text class="cell-title">管理人员:</text>
								<text class="cell-content">{{detail.technologyName || '未设置'}}</text>
							</view>
						</u-col>
						<u-col span="6">
							<view class="u-border-top1 cell-class u-border-bottom u-border-right">
								<text class="cell-title">联系电话:</text>
								<text class="cell-content">{{detail.technologyPhone || '未设置'}}</text>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="12">
							<view class="cell-class u-border-left u-border-bottom u-border-right">
								<text class="cell-title">养殖数量:</text>
								<text class="cell-content">{{detail.stock || 0}}{{detail.unit}}</text>
							</view>
						</u-col>
					</u-row>
					<u-row>
						<u-col span="12">
							<view class="cell-class u-border-left u-border-bottom u-border-right">
								<text class="cell-title">养殖品种:</text>
								<text class="cell-content">{{detail.varieties || '未设置'}}</text>
							</view>
						</u-col>
					</u-row>
				</view> -->
				<!-- <view class="foster-detail-content1">
					<view class="foster-detail-content1-title">养殖环境</view>
					<view class="foster-detail-content1-image">
						<u--image shape="circle" mode="aspectFill" :src="detail.ambient.image[0].url" width="50rpx" height="50rpx"></u--image>
						<view class="u-line-1 header-title-text">{{detail.ambient.name}}</view>
					</view>
					<view style="width: 100%; height: 362rpx;position: relative;">
						<map :polygons="polygons" style="width: 100%; height: 362rpx;" :scale="15" enable-satellite :latitude="latitude" :longitude="longitude"></map>
						<view class="map-title" @click="toHere">
							<text style="padding-right: 8rpx;">{{detail.ambient.address}}</text>
							<text class="iconfont icon-daohang" style="font-size: 28rpx;"></text>
						</view>
						<view class="map-title1" :style="{backgroundColor: appColor}">
							<text>占地{{square}}</text>
						</view>
					</view>
				</view> -->
				<!-- <view class="foster-detail-content1">
					<view class="foster-detail-content1-title">认养收获</view>
					<view class="foster-detail-content1-item u-border-bottom" v-for="(gainItem, index) in detail.gain" :key="index">
						<view class="foster-detail-content1-item-l" :style="{backgroundColor: appColor}">{{index + 1}}</view>
						<view class="foster-detail-content1-item-r">
							<u--image mode="aspectFill" :src="gainItem.image[0].url" width="32rpx" height="32rpx"></u--image>
							<text style="padding-left: 8rpx;">{{gainItem.remark}}</text>
						</view>
					</view>
				</view> -->
				<view class="foster-detail-content1" v-if="detail.problem && detail.problem.status">
					<view class="foster-detail-content1-title">常见问题</view>
					<u-collapse accordion :border="false">
					    <u-collapse-item
					      :title="item.question"
					      :name="index"
						  v-for="(item, index) in detail.problem.info"
						  :key="index"
					    >
					      <text class="u-collapse-content">{{item.answer}}</text>
					    </u-collapse-item>
					  </u-collapse>
				</view>
				<view class="foster-detail-content1" v-if="detail.description">
					<view class="foster-detail-content1-title">详情</view>
					<u-parse :content="detail.description"></u-parse>
					<!-- <u--image height="auto" mode="widthFix" src="https://hhymp.oss-cn-hangzhou.aliyuncs.com/home/foster-detail.png" width="100%"></u--image> -->
				</view>
				<u-back-top @click="intoView = 'top'" :scroll-top="scrollTop"></u-back-top>
			</template>
			
		</scroll-view>
		
		<view class="good-detail-bootom" v-if="!loading">
			<view style="margin: 0 16rpx;height: 100%;width: calc(100vw - 32rpx);display: flex;align-items: center;">
				<view class="good-detail-bootom-l1" @click="toHome">
					<button style="position: relative;top: 4rpx;" class="u-reset-button" >
						<u-icon :color="appColor" name="home-fill" size="26"></u-icon>
					</button>
					<button style="position: relative;top: -4rpx;" class="u-reset-button" >
						<text style="font-size: 24rpx; color: #666;">首页</text>
					</button>
				</view>	
				<view class="good-detail-bootom-l1">
					<button style="position: relative;top: 4rpx;" class="u-reset-button" open-type="contact">
						<u-icon :color="appColor" name="server-man" size="26"></u-icon>
					</button>
					<button style="position: relative;top: -4rpx;" class="u-reset-button" open-type="contact">
						<text style="font-size: 24rpx; color: #666;">客服</text>
					</button>
				</view>	
				<view class="good-detail-bootom-l1" @click="phone">
					<button style="position: relative;top: 4rpx;" class="u-reset-button">
						<u-icon :color="appColor" name="phone" size="26"></u-icon>
					</button>
					<button style="position: relative;top: -4rpx;" class="u-reset-button">
						<text style="font-size: 24rpx; color: #666;">电话</text>
					</button>
				</view>
				<view class="good-detail-bootom-r">
					<u-button :disabled="!detail.isAdopt || item.count === 0" @click="popupShow = true" :color="appColor" text="立即认养" shape="circle"></u-button>
				</view>
			</view>	
		</view>
		<u-modal @confirm="showPrice = false" :confirmColor="appColor" width="620rpx" :show="showPrice" title="价格说明" :content='detail.priceDescription'></u-modal>
		<echone-sku
			:show="popupShow" 
			 mode="forbidden"
			:theme-color="appColor" 
			:combinations="detail.adoptSku" 
			:specifications="detail.adoptSkuAttr" 
			:default-select-index="selectedIndex" 
			:combinations-props="combinationsProps"
			:specifications-props="specificationsProps"
			@close="handleClose" 
			@confirm="handleConfirm"
			:limitBuy="detail.limitBuy"
			:unit="detail.unit"
		></echone-sku>
	</view>	
</template>

<script>
	import {mapState, mapActions} from 'vuex';
	import {getProjectById} from '@/api/foster.js';
	import {getSensor} from '@/api/home.js';
	import TopBanner from '@/components/topBanner';
	import {noTokenToLogin} from '@/utils/index.js';
	
	export default {
		components: {
			TopBanner
		},
		data() {
			return {
				chartData: {},
				opts: {
					color: ['#f40215', '#f40215'],
					padding: [5,5,5,5],
					legend: {
					  show: true,
					  position: "right",
					  lineHeight: 25
					},
					extra: {
					  pie: {
						activeOpacity: 0.5,
						activeRadius: 10,
						offsetAngle: 0,
						labelWidth: 15,
						border: true,
						borderWidth: 3,
						borderColor: "#FFFFFF"
					  }
					}
				},
				popupShow: false,
				agreeShow: false,
				selectedIndex: 0,
				combinationsProps: {
					id: 'id',
					value: 'sku',
					image: 'image',
					price: 'price',
					stock: 'stock'
				},
				specificationsProps: {
					id: 'name',
					list: 'item',
					name: 'name'
				},
				color: 'transparent',
				bgColor: 'transparent',
				intoView: '',
				showPrice: false,
				sensorList: [], // 温湿度
				latitude: 29.39991,
				longitude: 106.81201,
				polygons: [],
				id: undefined,
				loading: true,
				points: [],
				markers: [],
				square: 0,
				curForster: [],
				scrollTop: 0,
				chooseSkuInfo: {}
			}
		},
		computed: {
			...mapState(['detail', 'appInfo']),
			appColor() {
				return this.appPrimaryColor
			},
			scrollViewHeight() {
				return this.scrollHeight - 50 + this.statusBarHeight + 'px';
			},
		},
		watch: {
			scrollTop(val) {
				if(val === 0) {
					this.intoView = ''
				}
			}
		},
		onShareAppMessage () {
			const {image, name, introduction, id} = this.detail;
			return {
				title: '[好友推荐]' + name,
				path: `/pages/foster/fosterDetail?id=${id}`,
				imageUrl: image[0].url,
				content: introduction,
				desc: introduction,
				success: res => {
					console.info(res)
				}
			}
		},
		methods: {
			...mapActions(['setActiveTabbar', 'setDetail']),
			handleClose() {
				this.popupShow = false;
			},
			handleConfirm(obj) {
				this.chooseSkuInfo = obj;
				noTokenToLogin(false).then(() => {
					console.log('未登录');
				}).catch(() => {
					this.toBuy();
				});
			},
			handleScroll({detail}) {
				this.scrollTop = detail.scrollTop
				this.intoView = ''
				if (detail.scrollTop > 100) {
					this.color = '#000';
					this.bgColor = '#fff';
				} else {
					this.color = 'transparent';
					this.bgColor = 'transparent';
				}
			},
			// 展示价格
			handleShowPrice() {
				this.showPrice = true
			},
			toBuy() {
				this.popupShow = false;
				let cur = uni.$u.deepClone(this.detail);
				cur.chooseSkuInfo = this.chooseSkuInfo;
				this.setDetail({detail: cur});
				let url = '/pages/foster/fosterOrder'
				this.$cuNavigateTo(url);
			},
			// 电话
			phone() {
				const {phone: phoneNumber} = this.appInfo;
				if(!uni.$u.test.mobile(phoneNumber)) {
					return this.$cuTip('手机号错误');
				}
				uni.makePhoneCall({
					phoneNumber
				});
			},
			// 首页
			toHome() {
				uni.reLaunch({
					url: '/pages/startup'
				})
			},
			// 返回
			back(type) {
				if(type === 'back') {
					uni.navigateBack({
						delta: 1
					})
				} else {
					uni.reLaunch({
						url: '/pages/startup'
					})
				}
				
			},
			// 去这里
			toHere() {
				const {region, name} = this.appInfo;
				const {latLng, square} = region[0];
				uni.openLocation({
					latitude:Number(latLng[0].lat),
					longitude:Number(latLng[0].lng),
					success: function() {
						console.log('success');
					}
				});
			},
			// 环境
			getSensor(sensorId) {
				getSensor({sensorId}).then(res => {
					this.sensorList = res.result
				})
			}, 
		},
		onLoad({id}) {
			this.opts.color[1] = this.appColor;
			const {region, name} = this.appInfo;
			const {latLng, square} = region[0];
			this.square = square;
			this.latitude = latLng[0].lat;
			this.longitude = latLng[0].lng;
			this.loading = false;
			// 判断是不是分享进来的
			if(id) {
				this.loading = true
				getProjectById({id}).then(res => {
					let res1 = {
						series: [
						  {
							data: [{"name":"已认养","value": res.result.salesNum, "labelText":`已认养:${res.result.salesNum}${res.result.unit}`},{"name":"未认养","value": res.result.stock - res.result.salesNum, "labelText":`未认养:${res.result.stock - res.result.salesNum}${res.result.unit}`}]
						  }
						]
					  };
					this.chartData = JSON.parse(JSON.stringify(res1));
					this.setDetail({detail: res.result});
					this.id = id;
				}).finally(() => {
					this.loading = false
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: rgba(242, 242, 242, 1);
	}
</style>
<style lang="scss" scoped>
	.u-nav-slot {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		border-radius: 100px;
		padding: 3px 7px;
	}
	.cell-class {
		line-height: 24rpx;
		padding: 16rpx 0 16rpx 16rpx;
		.cell-title {
			font-size: 24rpx;
			color: #666;
		}
		.cell-content {
			font-size: 24rpx;
			color: #000;
			padding-left: 8rpx;
		}
	}
	
	.map-title {
		position: absolute;
		bottom: 16rpx;
		left: 16rpx;
		z-index: 10; 
		color: #fff;
		font-size: 28rpx;
		line-height: 28rpx;
		padding: 12rpx 32rpx;
		border-radius: 48rpx;
		background-color: rgba(0, 0,0, 0.6);
	}
	.map-title1 {
		position: absolute;
		padding: 0 32rpx;
		height: 64rpx;
		top: 32rpx;
		left: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		transform: translateX(-50%);
		font-size: 28rpx;
		z-index: 10;
		color: #fff;
		font-weight: bold;
		opacity: 0.8;
		border-radius: 32rpx;
		white-space: nowrap;
	}
	.good-detail-bootom {
		background-color: #ffffff;
		position: fixed;
		height: 50px;
		width: 100vw;
		bottom: 0;
		left: 0;
		padding-bottom: constant(safe-area-inset-bottom);     /*兼容 iOS<11.2*/
		padding-bottom: env(safe-area-inset-bottom);  /*兼容 iOS>11.2*/
		box-sizing: content-box;
		.good-detail-bootom-l1 {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			margin-right: 48rpx;
		}
		.good-detail-bootom-r {
			flex: 2;
			text-align: right
		}
	}
	
	.foster-detail-content {
		margin-bottom: 16rpx;
		background-color: #fff;
		padding: 32rpx;
		.foster-detail-t {
			display: flex;
			align-items: center;
			justify-content: space-between;
			.foster-detail-t-1 {
				color: #333;
				font-size: 30rpx;
				font-weight: bold;
				max-width: 240rpx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.foster-detail-t1-js1 {
				color: #fff;
				margin-left: 16rpx;
				border-radius: 8rpx;
				padding: 0rpx 8rpx;
				font-size: 24rpx;
				background-color: #f40215;
			}
			.foster-detail-t-2 {
				height: 36rpx;
				line-height: 36rpx;
				padding: 4rpx 8rpx;
				color: #fff;
				font-size: 24rpx;
				border-radius: 8rpx;
				margin-left: 16rpx;
			}
		}
		.foster-detail-t-11 {
			padding: 16rpx 0;
			font-size: 24rpx;
			color: #666;
		}
		.foster-detail-m {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 8rpx 0 24rpx 0;
			.foster-detail-m-1 {
				background-color: rgba(254, 221, 218, 1);
				color: rgba(242, 74, 68, 1);
				font-size: 24rpx;
				text-align: center;
				line-height: 24rpx;
				padding: 8rpx 12rpx;
				border-radius: 8rpx;
			}
		}
		.foster-detail-t1 {
			padding-top: 8rpx;
			font-size: 26rpx;
			line-height: 26rpx;
			color: #666;
			.foster-detail-t1-js {
				color: #fff;
				font-size: 24rpx;
				border-radius: 8rpx;
				padding: 4rpx 8rpx;
			}
		}
		.foster-detail-b {
			display: flex;
			align-items: center;
			justify-content: space-between;
			.foster-detail-b-item {
				display: flex;
				align-items: center;
				.foster-detail-b-item-text {
					font-size: 24rpx;
					color: #666;
					padding-left: 8rpx;
				}
			}
		}
		.foster-detail-b1 {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 16rpx;
			.foster-item-b-l {
				display: flex;
				align-items: center;
				.foster-item-b-l-item {
					display: flex;
					align-items: center;
					color: #666;
					font-size: 24rpx;
					margin-right: 16rpx;
					.foster-item-b-l-item-text {
						padding-left: 4rpx;
					}
				}
			}
			.foster-item-b-r {
				display: flex;
			}
		}
	}
	.foster-detail-content1 {
		margin: 16rpx 0;
		padding: 32rpx;
		background-color: #fff;
		.env-box {
			margin-top: 16rpx;
			display: flex;
			justify-content: space-between;
			.env-item {
				width: 160rpx;
				height: 192rpx;
				border-radius: 10rpx;
				padding: 16rpx 0;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: center;
				.env-status {
					width: 56rpx;
					height: 30rpx;
					box-shadow: 0px 2rpx 3rpx rgba(0, 0, 0, 0.16);
					border-radius: 10rpx 0px 0px 10rpx;
					font-size: 20rpx;
					color: #fff;
					line-height: 30rpx;
					text-align: center;
					position: absolute;
					right: 0;
					top: 0;
				}
				.env-num {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					font-size: 32rpx;
					color: rgba(42, 175, 96, 1);
					font-weight: bold;
					.env-unit {
						font-size: 24rpx;
						font-weight: normal;
					}
					
				}
			}
			.env-item1 {
				background: rgba(211, 238, 221, 1);
			}
			.env-item2 {
				background: rgba(241, 231, 206, 1);
				.env-num {
					color: rgba(249, 146, 8, 1)
				}
			}
			.env-item3 {
				background: rgba(254, 221, 218, 1); 
				.env-num {
					color: rgba(242, 74, 68, 1);
				}
			}
			.env-item4 {
				background: rgba(233, 246, 209, 1); 
				.env-num {
					color: rgba(96, 175, 42, 1);
				}
			}
		}
		.foster-detail-content1-title {
			font-size: 32rpx;
			line-height: 32rpx;
			color: #333;
			margin-bottom: 32rpx;
			font-weight: bold;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
		.foster-item-choose-title {
			display: flex;
			align-items: center;
			justify-content: space-around;
			padding-bottom: 16rpx;
			.foster-item-choose-title-item {
				display: flex;
				align-items: center;
				.foster-item-choose-title-item-color {
					width: 32rpx;
					height: 32rpx;
					border-radius: 8rpx;
				}
				.foster-item-choose-title-item-text {
					color: #000;
					font-size: 28rpx;
					padding-left: 8rpx;
				}
			}
		}
		.foster-item-choose {
			width: 120rpx;
			height: 240rpx;
			margin-right: 16rpx;
			display: inline-block;
			.foster-item-choose-text {
				height: 180rpx;
				text-align: center;
				color: #fff;
				font-size: 24rpx;
				line-height: 28rpx;
				padding-top: 16rpx;
				border-radius: 16rpx;
				.foster-item-choose-text-step {
					text-align: center;
					font-size: 24rpx;
					margin-bottom: 16rpx;
				}
			}
			.foster-item-choose-con {
				height: calc(100% - 180rpx);
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
		.foster-detail-content1-image {
			display: flex;
			align-items: center;
			margin-bottom: 16rpx;
			.header-title-text {
				font-size: 28rpx;
				margin-left: 16rpx;
			}
		}
		.foster-detail-content1-item {
			display: flex;
			align-items: center;
			padding: 16rpx 0;
			.foster-detail-content1-item-l {
				width: 32rpx;
				height: 32rpx;
				border-radius: 16rpx;
				line-height: 32rpx;
				color: #fff;
				font-size: 24rpx;
				text-align: center;
				margin-right: 12rpx;
			}
			.foster-detail-content1-item-r {
				flex: 1;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				color: #666;
				display: flex;
				align-items: center;
			}
		}
	}
</style>
